<?php session_start();
	  require_once ("../adm_usuarios.php");
	  val_modulo(9);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Código del Icono -->			
<link href="../images/logo.ico" type="image/x-icon" rel="shortcut icon" />			
<!-- InstanceBeginEditable name="doctitle" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SAPSIL</title>
<link href="../styles/tesis.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="../scripts/jquery162.js"></script>
<script type="text/javascript" src="../scripts/error_list.js"></script>
<?php
        /* Conexion a la base de datos */
	require_once("../conexion/conexion.php");
       
?>
<!-- start jquery ui -->
<link href="../styles/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="../styles/jquery-ui.min.js"></script>
<script src="../scripts/gen_validate.js" type="text/javascript"></script>
<!-- end jquery ui -->


<script type="text/javascript">

$(document).ready(function() {
    showLog(<?php echo $logueo; ?>);
    <?php if($logueo == TRUE){echo habilitar_menu();} ?>
    
    $("#tabs").tabs();
    $('#seltipusu').val('');
    $('#selDepto').val('');
    $('#seltipusu').change(function(){
        var ban = $(this).val();
        if ( ban == 1)
        {
            $('.seltipUsuIn').show();
            $('.seltipUsuEx').hide();
            $('.seltipUsuEx').val('');
            $('.seltipIns').hide();
            $('.seltipEmp').hide();
            $('.seltipIns').val('');
            $('.seltipEmp').val('');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.UsuInt').show();
        }
        else if ( ban == 2)
        {
            $('.seltipUsuIn').hide();
            $('.seltipUsuIn').val('');
            $('.seltipUsuEx').show();
            $('.seltipIns').val('');
            $('.seltipEmp').val('');
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('.UsuInt').hide();
        }
        else if ( ban == "")
        {
            $('.seltipUsuIn').hide();
            $('.seltipUsuEx').hide();
            $('.seltipUsuIn').val('');
            $('.seltipUsuEx').val('');
            $('.seltipIns').hide();
            $('.seltipEmp').hide();
            $('.seltipIns').val('');
            $('.seltipEmp').val('');
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('.UsuInt').hide();
        }
    });
    $('.seltipUsuEx').change(function(){
        var ban = $(this).val();
        if ( ban == 1)
        {
            $('.seltipIns').show();
            $('.seltipEmp').hide();
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
        }
        else if ( ban == 2)
        {
            $('.seltipIns').hide();
            $('.seltipEmp').show();
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
        }
        else if ( ban == "")
        {
            $('.seltipIns').hide();
            $('.seltipEmp').hide();
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
        }
    });
    $('#selususil').change(function(){
        var ban = $(this).val();
        if ( ban == 5)
        {
            $('.chkadm').show();
            $('.chkadm').attr('checked','checked');
            $('#spContra').html('')
        }
        else if ( ban == 4)
        {
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkemp').show();
            $('.chkemp').attr('checked','checked');
            $('#spContra').html('')
        }
        else if ( ban == 3)
        {
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkfor').show();
            $('.chkfor').attr('checked','checked');
            $('#spContra').html('')
        }
        else if ( ban == 2)
        {
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkori').show();
            $('.chkori').attr('checked','checked');
            $('#spContra').html('')
        }
        else if ( ban == 1)
        {
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkrep').show();
            $('.chkrep').attr('checked','checked');
            $('#spContra').html('*')
        }
        else if ( ban == "")
        {
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('#spContra').html('')
        }
    });
    $('#selusuins').change(function(){
        var ban = $(this).val();
        if ( ban == 1)
        {
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkinst').show();
            $('.chkinst').attr('checked','checked');
            
        }
        else if ( ban == 2)
        {
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
            $('.chkempre').show();
            $('.chkempre').attr('checked','checked');
        }
        else if ( ban == "")
        {
            $('.chkextins').hide();
            $('.chkextins').removeAttr('checked');
            $('.chkadm').hide();
            $('.chkadm').removeAttr('checked');
        }
    });
    
  }); // Fin document ready
  
    function validar_ingreso_usu ()
        {
            if(validar_element('seltipusu', '', error101)== false){return;}
            if($('#seltipusu').val() == 1)
            {
                if(validar_element('txtnomusu', '', error102)== false){return;}
                if(validar_element('txtapeusu', '', error103)== false){return;}
                if(validar_element('selTipDoc', '', error104)== false){return;}
                if(validar_element('txtNumDoc', '', error105)== false){return;}
				if ($('#selTipDoc').val() == 1)
				{
					//VALIDAR DUI LONGITUD
					if(valDUI($('#txtNumDoc').val()) == false) {  
							alert("Numero de documento incorrecto");  
							 $("#txtNumDoc").val('');
							return;  
					} 
				}
                if(validar_element('selgenusu', '', error106)== false){return;}
                if(validar_element('selDepto', '', error107)== false){return;}
                if(validar_element('selMun', '', error108)== false){return;}
				
				if ($('#selususil').val() == 1)
				{
					if(trim($('#txtCorreo').val()) == '')
					{
						alert("Ingrese el correo");
						return;
					}// fin if
						
				  }// fin selususil
				if(trim($('#txtCorreo').val()) != '')
					{
				  	 if (validarEmail($('#txtCorreo').val())== false){
  				     	   alert("Favor ingrese un correo valido");
   				     	  $("#txtCorreo").val('');
     				  	   return;

     					  }
					}//fin if
            }
            if($('#seltipusu').val() == 1)
                {
                    if(validar_element('selususil', '', error109)== false){return;}
                }
            if($('#seltipusu').val() == 2)
                {
                    if(validar_element('selusuins', '', error109)== false){return;}
                }
            if(validar_element('selestusu', '', error110)== false){return;}
            if(validar_element('txtusu', '', error111)== false){return;}
            if(validar_element('txtpassusu', '', error112)== false){return;}
            if(validar_element('txtpassusucon', '', error113)== false){return;}
            if($("#txtpassusu").val().length < 8)
            { 
               $("#txtpassusu").val(''); 
               $('#txtpassusucon').val(''); 
               $("#txtpassusu").focus();
               alert(error117);
               return;
            }
            if(trim($('#txtpassusu').val()) != trim($('#txtpassusucon').val()))
            {
                $('#txtpassusu').val(''); 
                $('#txtpassusucon').val('');
                $('#txtpassusu').focus();
                alert(error114);
                return;
            }
            if(trim($('#txtpassusu').val()) == trim($('#txtusu').val()))
            {
                $('#txtpassusu').val(''); 
                $('#txtpassusucon').val('');
                $('#txtpassusu').focus();
                alert(error122);
                return;
            }
            if ($('#selusuins').val() == 1)
                {
                    if(validar_element('selusucap', '', error115)== false){return;}
                }
            if ($('#selusuins').val() == 2)
                {
                    if(validar_element('selusuemp', '', error116)== false){return;}
                }
			 
            // AJAX VALIDAR DOCUMENTO
            $.ajax({
                url: "../lib/ValDoc.php",
                type: "GET",
                data: "Opcion=3&NumDoc="+$("#txtNumDoc").val()+"&TipoDoc="+$("#selTipDoc").val(),
                success: function(datos)
                {

                    if(datos == 1)
                    {
                        alert("Este documento para el usuario ya se encuentra registrado");
                        $("#txtNumDoc").val("");
                        $("#txtNumDoc").focus();
                        return;
                    }
                    else
                    {
                        // AJAX VALIDAR USUARIO
                        $.ajax({
                            url: "../lib/valUsuario.php",
                            type: "GET",
                            data: "Usuario="+$('#txtusu').val(),
                            success: function(datos)
                            {
                                if(datos == 1)
                                {
                                    alert("Este usuario ya se encuentra registrado");
                                    $("#txtusu").val("");
                                    $("#txtusu").focus();
                                    return;
                                }
                                else
                                {
                                    // AJAX INGRESAR USUARIO
                                    $.ajax({
                                        url: "../lib/InsUsuario.php",
                                        type: "GET",
                                        data: obtener_parametros_usu(),
                                        success: function(datos)
                                        {
                                            if (datos == "OK")
                                            {
                                                alert(msgIngresadosOK);
                                            }
                                            else
                                            {
                                                alert(msgIngresadosERROR + " Error: " + datos);
                                            }
                                            location.reload();
                                        }
                                    });
                                }
                            }
                        });
                         
                    }

                }
            });
                
           
        }
        function obtener_parametros_usu()
        {
            var habval = 0;
            if($('#chkhabval').attr('checked') == 'checked')
              {
                  habval = 1;
              }
            var datos = "TipUsu="+trim($('#seltipusu').val())+"&NomUsu="+trim($('#txtnomusu').val())+
                        "&ApeUsu="+trim($('#txtapeusu').val())+"&TipDoc="+trim($('#selTipDoc').val())+
                        "&NumDoc="+trim($('#txtNumDoc').val())+"&GenUsu="+trim($('#selgenusu').val())+"&CorrUsu="+trim($('#txtCorreo').val())+
                        "&DepUsu="+trim($('#selDepto').val())+"&MunUsu="+trim($('#selMun').val())+
                        "&UsuTipIn="+trim($('#selususil').val())+"&UsuTipEx="+$('#selusuins').val()+
                        "&EstUsu="+trim($('#selestusu').val())+"&NickUsu="+trim($('#txtusu').val())+
                        "&PassUsu="+trim($('#txtpassusu').val())+"&InsCap="+trim($('#selusucap').val())+
                        "&InsEmp="+trim($('#selusuemp').val())+"&DesUsu="+trim($('#txtdesusu').val())+
                        "&HabVal="+habval+"&strXml="+obtener_chkbox();
            return datos;
        }
        function obtener_chkbox ()
        {
            var respuesta = "<NP>";
            var cont = 1;
            $('.chkdat').each(function(){
                 if($(this).attr('checked') == 'checked')
                 {
                     respuesta += "<CHK"+cont+">1</CHK"+cont+">";
                 }
                 else
                 {
                     respuesta += "<CHK"+cont+">0</CHK"+cont+">";
                 }
                 cont ++;
            });
            respuesta += "</NP>";
            return respuesta;
        }

function showLogin()
{
$(".loginbox").slideToggle("slow");
}

function obtMun()
{
		$.ajax({
				url: "../lib/GetMun.php",
				type: "GET",
				data: "DeptoSel="+$("#selDepto").val(),
				success: function(datos){
				$('#selMun').html(datos);
				}
		});
}

//datepicker

	$(function() {
		$( ".datepicker" ).datepicker({
			showOn: "button",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true
		});
	});

</script>
<!-- InstanceEndEditable -->
<link href="../styles/tesis.css" rel="stylesheet" type="text/css" media="screen" />

<!-- Script Accordeon Menu -->
<script type="text/javascript" src="../scripts/ddaccordion.js"></script>
<script type="text/javascript">

ddaccordion.init({ //top level headers initialization
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})

ddaccordion.init({ //2nd level headers initialization
	headerclass: "subexpandable", //Shared CSS class name of sub headers group that are expandable
	contentclass: "subcategoryitems", //Shared CSS class name of sub contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["opensubheader", "closedsubheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})


</script>

<!-- Script Accordeon Menu -->
<style type="text/css">
<!--
.Estilo1 {
	font-size: 12px;
	font-style: italic;
	font-weight: bold;
}
.Estilo5 {font-style: italic; font-size: 12px;}
.Estilo6 {color: #FF0000}
.Estilo7 {font-size: 14px}
.Estilo8 {font-size: 16px}
.Estilo9 {
	font-weight: bold;
	font-size: 14px;
} 
.Estilo12 {font-size: 11px}
-->
</style>

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body>

<div class="container">
   <div class="header"><!-- #BeginLibraryItem "/Library/loginbox.lbi" -->
    <div class="loginButton login"><a onclick="showLogin()" href="javascript:;">Login</a></div>
    <div class="logoutButton logout" style="display:none"><a onclick="javascript:logout('../lib/logoff.php')" href="javascript:;">Bienvenido <?php if(isset($_SESSION['USU_NAME'])){ echo $_SESSION['USU_NAME'];} ?> <br /> Logout</a></div> 
<div class="loginbox">
    <form id="frm_login" name="frm_login" method="post" action="">
      <p>
        <label for="log_username">Usuario: </label>
        <input name="log_username" type="text" class="input-width" id="log_username" />
      </p>
      <p>
        <label for="log_password">Password: </label>
        <input name="log_password" type="password" class="input-width" id="log_password" /><span class="submit"><a href="javascript:validarIngreso('../lib/validarUsuario.php');">&nbsp;</a> </span>
      </p>
    </form>
  </div><!-- end .loginbox--><!-- #EndLibraryItem --><!-- #BeginLibraryItem "/Library/logo.lbi" --><a href="#"><img src="../images/logo2.jpg" alt="Insert Logo Here" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background: #f7d10e; display:block;" /></a><!-- #EndLibraryItem --><!-- #BeginLibraryItem "/Library/navigation.lbi" --><div class="navigation">
      <ul class="nav">
        <li><a id="lnkEmp" class="lnkPrin" href="#">Empleo</a></li>
        <li><a id="lnkFor" class="lnkPrin" href="#">Formacion</a></li>
        <li><a id="lnkOri" class="lnkPrin" href="#">Orientacion</a></li>
        <li><a id="lnkRec" class="lnkPrin" href="#">Recepcion</a></li>
      </ul>
    </div><!-- #EndLibraryItem --><!-- end .navigation-->
  
  
  
  <!-- end .header --></div>
  <div class="sidebar1"><!-- #BeginLibraryItem "/Library/sidebar navigation.lbi" -->
      <div class="arrowlistmenu">
          <div id="menCita" class="menuShow" style="display:none">
           <h3 class="menuheader expandable">Citas</h3>
            <ul class="categoryitems captura">
              <li><a href="../cita/cit_registrar.php">Registro de Persona</a></li>
              <li><a href="../cita/cit_registrarc.php">Concertación de Cita</a></li>
              <li><a href="../cita/cit_buscar.php">Buscar Cita </a></li>
              <li><a href="../cita/cit_programadas.php" >Citas Programadas</a></li>
              <li><a href="../cita/cit_desbloq.php">Habilitar Usuario</a></li>
            </ul>
          </div>
          <div id="menRece" class="menuShow" style="display:none">
	  <h3 class="menuheader expandable">Recepcion</h3>
            <ul class="categoryitems captura">
              <li><a href="../rece/exp_crear.php" >Crear Expediente</a></li>
			  <li><a href="../regi/regi_interesados.php">Registro Interesados</a></li>
              <li><a href="../rece/exp_buscar.php">Buscar Expediente</a></li>
            </ul>
          </div>
          <div id="menOrie" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Orientacion</h3>
            <ul class="categoryitems captura">
              <li><a href="../orie/ori_busqueda_exp.php">Busqueda Orientacion</a></li>
              <li><a href="../orie/ori_busqueda_ori.php">Consultas de Orientacion</a></li>
            </ul>
          </div>
          <div id="menForm" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Formacion</h3>
            <ul class="categoryitems captura">
              <li><a href="../form/for_regformativa.php">Ingreso de Institucion</a></li>
              <li><a href="../form/for_regcurso.php?For=">Ingreso de Curso</a></li>
			  <li><a href="../form/for_listar_personas.php">Candidatos a Curso</a></li>
              <li><a href="../form/for_busformativa.php" >Busqueda de Institucion</a></li>
              <li><a href="../form/for_buscurso.php" >Busqueda de Curso</a></li>
            </ul>
          </div>
	  <div id="menEmpl" class="menuShow" style="display:none">			
	    <h3 class="menuheader expandable">Empleo</h3>
            <ul class="categoryitems captura">
             <li><a href="../empl/emp_registrar.php">Ingreso de Empresa</a></li>
             <li><a href="../empl/emp_registrar_oferta.php?Empresa=">Registrar Oferta</a></li>
             <li><a href="../empl/emp_buscar.php">Busqueda de Empresa</a></li>
             <li><a href="../empl/emp_buscar_oferta.php">Busqueda de Ofertas</a></li>
             <li><a href="../empl/emp_listar_candidatos.php">Busqueda de Candidatos</a></li>
            </ul>
          </div>
          <div id="menSegu" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Seguimiento</h3>
            <ul class="categoryitems captura">
              <li><a href="../acci/acc_regaccion.php">Registro de Seguimiento</a></li>
              <li><a href="../acci/acc_busaccion.php">Busqueda de Seguimiento</a></li>
            </ul>
          </div>
          <div id="menRepo" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Reportes</h3>
            <ul class="categoryitems captura">
              <li><a href="../repo/rep_buscar_curriculo.php">Generacion de Curriculum</a></li>
              <li><a href="../repo/rep_orientacion.php">Reportes Orientacion</a></li>
              <li><a href="../repo/rep_formacion.php">Reportes Formacion</a></li>
              <li><a href="../repo/repo_empleo.php" >Reportes Empleo</a></li>
              <li><a href="../repo/rep_acciones.php" >Reportes Acciones</a></li>
			  <li><a href="../repo/rep_interesados.php">Reportes Interesados</a></li>
			</ul>
          </div>
		   
           <div id="menVist" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Ver Expediente</h3>
            <ul class="categoryitems captura">
                <li><a href="../vist/vis_busqueda.php">Vista de Expediente</a></li>
            </ul> 
          </div>
          <div id="menAdmi" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Administracion</h3>
            <ul class="categoryitems">
              <li id="menSusu" style="display:none"><a href="#" class="subexpandable">Usuario</a>
                <ul class="subcategoryitems">
                    <li><a href="usu_registrar.php" >Registro de Usuario</a></li>
                    <li><a href="usu_buscar.php">Busqueda de Usuario</a></li>
                    <li><a href="usu_habilitar.php">Administracion de seguridad</a></li>
                    <li><a href="adm_sesion.php">Tiempo de sesion</a></li>
         	</ul>
              </li> 
              <li id="menCata" style="display:none"><a href="#" class="subexpandable">Catalogos</a>
                <ul class="subcategoryitems">
                  <li><a href="cat_registrar.php">Registro de Catalogo</a></li>
                  <li><a href="cat_buscar.php">Busqueda de Catalogo</a></li> 
                </ul>
              </li>
            </ul>
          </div>  
          <div id="menInst" class="menuShow" style="display:none">
              <h3 class="menuheader expandable">Instituci&oacute;n</h3>
            <ul class="categoryitems captura">
              <li><a href="../form/for_regcurso.php">Ingreso de cursos</a></li>
              <li><a href="../form/for_cursos_por_institucion_capacitadora.php">Ver cursos</a></li>
            </ul>
          </div>
          <div id="menEmpr" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Empresa</h3>
            <ul class="categoryitems captura">
              <li><a href="../empl/emp_registrar_oferta.php">Ingreso de oferta</a></li>
              <li><a href="../empl/emp_ofertas_x_empresa_institucion.php">Ver ofertas</a></li>
            </ul>
          </div>
		  <div id="menCamP" class="menuShow" style="display:none">
            <h3 class="menuheader expandable">Mi cuenta</h3>
            <ul class="categoryitems captura">
              <li><a href="usu_modpass.php">Cambio de contraseña</a></li>
            </ul>
          </div>
          </div><!-- #EndLibraryItem --><p></p> 
         <a href="../Ayuda/ayuda_sil/ayuda_sapsil.chm"><h5 align="center">Ayuda
        <img src="../images/ayuda.gif" width="107" height="98" /></h5></a>   
    <!-- end .sidebar1 --></div>
  <div class="content"><!-- InstanceBeginEditable name="contenido" -->
  <form action="usu_registrar2.php" method="post" name="form1" class="frm" id="form1">
   <h3><font color='#0000A0'>Registro de Usuario</font></h3>
   <p><i>Favor ingrese la informacion siguiente, para registrar un usuario.</br> Los datos requeridos se muestran con un asterisco (<span class="Estilo6">*</span>)</i></p>
		<p></p>
    
      <p>
        <label for="seltipusu"><span class="Estilo6">*</span>Tipo de usuario: </label>
        <select name="seltipusu" id="seltipusu">
          <option selected="selected" value=""> Seleccione </option>
          <option value="1">Usuario interno</option>
          <option value="2">Usuario externo</option>
        </select>
      </p>
        <p>&nbsp;</p>
      <!-- <p>
            <label for="txtcodusu"> C&oacute;digo: </label>
            <input type="text" name="txtcodusu" id="txtcodusu"  readonly="readonly"/>
      </p> -->
      <p style="display: none" class="UsuInt">
        <label for="txtnomusu"><span class="Estilo6">*</span>Nombre:</label>
        <input type="text" name="txtnomusu" id="txtnomusu"  onkeypress="return permitir(event,'car')" maxlength="30"/>
        <label for="txtapeusu"><span class="Estilo6">*</span>Apellido:</label>
        <input type="text" name="txtapeusu" id="txtapeusu"  onkeypress="return permitir(event,'car')" maxlength="30"/>
      </p>
      <p style="display: none" class="UsuInt">
          <label for="selTipDoc"><span class="Estilo6">*</span>Tipo de documento</label>
            <select name="selTipDoc" id="selTipDoc" class="bloquear">
			<option selected="selected" value="">Seleccione</option>
                        <?php
                                    
									$sql = "SELECT CTID_CODIGO, CTID_NOMBRE FROM CAT_TIPO_DOCUMENTO WHERE CTID_ESTADO='A'";
                                    $result = mysql_query($sql);
                                            while ($row=mysql_fetch_array($result))
                                                    {
                                                            echo "<option value=".$row["CTID_CODIGO"].">".$row["CTID_NOMBRE"]."</option>";
                                                    }
                                            mysql_free_result($result);
                        ?>
            </select>
          <label for="txtNumDoc">&nbsp;<span class="Estilo6">*</span>No documento:</label>
          <input type="text" name="txtNumDoc" id="txtNumDoc" maxlength="11" class="bloquear" onkeypress="return permitir(event,'num')"/>
      </p>
        <p style="display: none" class="UsuInt">
            <label for="selgenusu"><span class="Estilo6">*</span>Sexo:</label>
            <select name="selgenusu" id="selgenusu" class="bloquear">
              <option value='' selected="selected"> Seleccione </option>
              <option value="F">Femenino</option>
              <option value="M">Masculino</option>
            </select>
            <label for="selgenusu"><span id="spContra" class="Estilo6"></span>Correo:</label>
           <input type="text" name="txtCorreo" id="txtCorreo" maxlength="50" onkeypress="return permitir(event,'e-mail')" class="Inicializar bloquear"/>
            
        </p>
        <p style="display: none" class="UsuInt">
            <label for="selDepto"><span class="Estilo6">*</span>Departamento</label>
			<select name="selDepto" id="selDepto" onChange="obtMun()" class="bloquear">
					<option selected value="">Seleccione</option>
            <?php
			/* 	 Descripci�n: Funcion encargada de recibir los parametros del formulario usu_registrar.php y enviarlos al procedimiento 			                  SP_INSERT_USU el cual ingresa los datos en la tabla Usuario
					 Fecha creaci�n: 13/09/2011 
					 Fecha �ltima modificaci�n: 14/09/2011
			*/
 
			$sql = "SELECT * FROM CAT_DEPARTAMENTO WHERE CAD_ESTADO='A' ORDER BY CAD_NOMBRE";
			$result = mysql_query($sql);
				while ($row=mysql_fetch_array($result))
					{
						echo "<option value=".$row["CAD_CODIGO"].">".$row["CAD_NOMBRE"]."</option>";
					}
            echo "</select>";
			mysql_free_result($result);
			?>
			
            <label for='selMun'>&nbsp;<span class="Estilo6">*</span>Municipio:</label>
            <select name='selMun' id='selMun' class="bloquear">
                <option selected value="">Seleccione</option>
            </select>
			
			
          </p>
      <p>
        <label for="selususil" style="display: none;" class="seltipUsuIn"><span class="Estilo6">*</span>Nivel de usuario:</label>
        <select name="selususil" id="selususil" style="display: none;" class="seltipUsuIn">
          <option selected="selected" value=""> Seleccione </option>
          <?php

            $sql = "SELECT CAR_CODIGO, CAR_NOMBRE FROM CAT_AREA WHERE CAR_ESTADO = 'A' ORDER BY CAR_NOMBRE";
            $result = mysql_query($sql);
                    while ($row=mysql_fetch_array($result))
                            {
                                    echo "<option value=".$row["CAR_CODIGO"].">".$row["CAR_NOMBRE"]."</option>";
                            }
                    mysql_free_result($result);
          ?>
        </select>
        <label for="selusuins" style="display: none;" class="seltipUsuEx"><span class="Estilo6">*</span>Nivel de usuario:</label>
        <select name="selusuins" id="selusuins" style="display: none;" class="seltipUsuEx">
          <option selected="selected" value=""> Seleccione </option>
          <option value="1">Instituci&oacute;n capacitadora</option>
          <option value="2">Instituci&oacute;n empleo</option>
        </select>
        <label for="selestusu"><span class="Estilo6">*</span>Estado Usuario </label>
        <select name="selestusu" id="selestusu">
          <option selected="selected" value=""> Seleccione </option>
          <option value="A">Activo</option>
          <option value="I">Inactivo</option>
        </select>
      </p>
        <p>&nbsp;</p>  
      <p>
          <label for="txtusu"><span class="Estilo6">*</span>Usuario:</label>
          <input name="txtusu" id="txtusu" type="text" onkeypress="return permitir(event,'pass')" maxlength="12"/>    
          <label for="txtpassusu"><span class="Estilo6">*</span>Contrase&ntilde;a:</label>
          <input name="txtpassusu" id="txtpassusu" type="password" onkeypress="return permitir(event,'pass')" maxlength="50"/>    
          <label for="txtpassusucon"><span class="Estilo6">*</span>Confirmaci&oacute;n contrase&ntilde;a:</label>
          <input name="txtpassusucon" id="txtpassusucon" type="password" onkeypress="return permitir(event,'pass')" maxlength="50"/>    
      </p>
      <p>
        <label for="selusucap" class="seltipIns" style="display: none;"><span class="Estilo6">*</span>Seleccione Instituci&oacute;n:</label>
        <select name="selusucap" id="selusucap" class="seltipIns" style="display: none;">
          <option selected="selected" value=""> Seleccione </option>
                 <?php
			
			$sql = "SELECT form.INS_CODIGO, inst.INS_NOMBRE 
					FROM FORMATIVA form INNER JOIN INSTITUCION inst ON form.INS_CODIGO = inst.INS_CODIGO 
					WHERE inst.INS_ESTADO = 'A'";
			$result = mysql_query($sql);
				while ($row=mysql_fetch_array($result))
					{
						echo "<option value=".$row["INS_CODIGO"].">".$row["INS_NOMBRE"]."</option>";
					}
                        echo "</select>";
			mysql_free_result($result);
		?>
        </select>
          <label for="selusuemp" class="seltipEmp" style="display: none;"><span class="Estilo6">*</span>Seleccione <br /> empresa:</label>
        <select name="selusuemp" id="selusuemp" class="seltipEmp" style="display: none;">
          <option selected="selected" value=""> Seleccione </option>
                <?php
			
			$sql = "SELECT emp.INS_CODIGO, ins.INS_NOMBRE 
					FROM EMPRESA emp INNER JOIN INSTITUCION ins ON emp.INS_CODIGO = ins.INS_CODIGO 
					WHERE ins.INS_ESTADO = 'A'";
			$result = mysql_query($sql);
				while ($row=mysql_fetch_array($result))
					{
						echo "<option value=".$row["INS_CODIGO"].">".$row["INS_NOMBRE"]."</option>";
					}
                        echo "</select>";
			mysql_free_result($result);
		?>
        </select>
        <label for="txtdesusu">Descripci&oacute;n: </label>
        <textarea name="txtdesusu" id="txtdesusu" cols="45" rows="5" onkeypress="return permitir(event,'direccion')"></textarea> 
        <input name="chkhabval" type="checkbox" class="year-box" id="chkhabval" style="display: none"/>
        <label for="chkhabval" style="display: none">Habilitar vencimiento.  </label> 
      </p>
        <p>&nbsp;</p>
      <p>
        <input name="chkhabcit" type="checkbox" class="year-box chkadm chkrep chkdat" id="chkhabcit" style="display: none;"/>
        <label for="chkhabcit" style="display: none;" class="chkadm chkrep">Habilitar <br />cita.  </label>
        <input name="chkhabrec" type="checkbox" class="year-box chkadm chkrep chkdat" id="chkhabrec" style="display: none;"/>
        <label for="chkhabrec" style="display: none;" class="chkadm chkrep">Habilitar <br />recepci&oacute;n.  </label>
        <input name="chkhabori" type="checkbox" class="year-box chkadm chkori chkdat" id="chkhabori" style="display: none;"/>
        <label for="chkhabori" style="display: none;" class="chkadm chkori">Habilitar <br />orientaci&oacute;n.  </label>
        <input name="chkhabfor" type="checkbox" class="year-box chkadm chkfor chkdat" id="chkhabfor" style="display: none;"/>
        <label for="chkhabfor" style="display: none;" class="chkadm chkfor">Habilitar <br />formaci&oacute;n.  </label>
      </p>
      <p>
        <input name="chkhabemp" type="checkbox" class="year-box chkadm chkemp chkdat" id="chkhabemp" style="display: none;"/>
        <label for="chkhabemp" style="display: none;" class="chkadm chkemp">Habilitar <br />empleo.  </label>
        <input name="chkhabseg" type="checkbox" class="year-box chkemp chkfor chkori chkdat" id="chkhabseg" style="display: none;"/>
        <label for="chkhabseg" style="display: none;" class="chkemp chkfor chkori">Habilitar <br />seguimiento.  </label>
        <input name="chkhabrep" type="checkbox" class="year-box chkadm chkemp chkfor chkori chkrep chkdat" id="chkhabrep" style="display: none;"/>
        <label for="chkhabrep" style="display: none;" class="chkadm chkemp chkfor chkori chkrep">Habilitar <br />reportes.  </label>
        <input name="chkhabcat" type="checkbox" class="year-box chkadm chkrep chkdat" id="chkhabcat" style="display: none;"/>
        <label for="chkhabcat" style="display: none;" class="chkadm chkrep">Habilitar <br />catalogos.  </label>
      </p>
      <p>
        <input name="chkhabvis" type="checkbox" class="year-box chkadm chkemp chkfor chkori chkrep chkdat" id="chkhabvis" style="display: none;"/>
        <label for="chkhabvis" style="display: none;" class="chkadm chkemp chkfor chkori chkrep">Habilitar <br />vista.  </label>
        <input name="chkhabempIn" type="checkbox" class="year-box chkextins chkempre chkdat" id="chkhabemp" style="display: none;"/>
        <label for="chkhabempIn" style="display: none;" class="chkextins chkempre">Habilitar <br />empresa.  </label>
        <input name="chkhabins" type="checkbox" class="year-box chkextins chkinst chkdat" id="chkhabins" style="display: none;"/>
        <label for="chkhabins" style="display: none;" class="chkextins chkinst">Habilitar <br />instituci&oacute;n.  </label>
        <input name="chkhabusu" type="checkbox" class="year-box chkadm chkdat" id="chkhabusu" style="display: none;"/>
        <label for="chkhabusu" style="display: none;" class="chkadm">Habilitar <br />usuarios.  </label>
      </p>
        <p>&nbsp;</p>
        <p>
        <a href="javascript:validar_ingreso_usu();" class="myButton"> Crear usuario </a>
      </p>
      <p>&nbsp;</p>
    </form>
<!-- InstanceEndEditable --><!-- end .content -->  </div><!-- #BeginLibraryItem "/Library/footer.lbi" --><div class="footer">
    <p>Derechos Reservados copyright ©</p>
    <!-- end .footer --></div><!-- #EndLibraryItem --><!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>
